package com.nangle.managehost.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.nangle.managehost.R;
import com.nangle.managehost.entity.Doctor;

import java.util.List;

/**
 * Created by YFB on 2017/3/21.
 */

public class NurseDetailAdapter extends BaseAdapter {
    private LayoutInflater mInflater;
    private Context mContext;
    private List<Doctor> mDatas;
    public NurseDetailAdapter(Context context, List<Doctor> mDatas) {
        mInflater = LayoutInflater.from(context);
        this.mContext = context;
        this.mDatas = mDatas;
    }
    @Override
    public int getCount() {
        return mDatas.size();
    }

    @Override
    public Object getItem(int position) {
        return mDatas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        if(convertView == null){
            convertView = mInflater.inflate(R.layout.nurse_detail_item, parent, false);
        }else {
            viewHolder = (NurseDetailAdapter.ViewHolder) convertView.getTag();
        }
        return convertView;
    }
    private final class ViewHolder {
        TextView mTextView;
    }
}
